using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Data.Models.Mapping
{
    public class BOMDetailMap : EntityTypeConfiguration<BOMDetail>
    {
        public BOMDetailMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Description)
                .HasMaxLength(1000);

            // Table & Column Mappings
            this.ToTable("BOMDetails");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.BOMID).HasColumnName("BOMID");
            this.Property(t => t.MaterialID).HasColumnName("MaterialID");
            this.Property(t => t.Quantity).HasColumnName("Quantity");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.UnitID).HasColumnName("UnitID");
        }
    }
}
